package com.demo.work.main;


import com.sun.deploy.util.StringUtils;

import java.io.*;
import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author lyf
 */
public class AddNumber {
    static Pattern pattern = Pattern.compile("^\\d*\\.");
    public static void main(String[] args) throws IOException {
        InputStream in = new FileInputStream(StringUtils.join(Arrays.asList(System.getProperty("user.dir"), "src", "main", "resources","task.txt"), File.separator));
        BufferedReader b = new BufferedReader(new InputStreamReader(in));
        AtomicInteger index = new AtomicInteger(1);


        b.lines().distinct().forEach(e -> {
            Matcher matcher = pattern.matcher(e);
            System.out.println(String.format("%d.%s", index.getAndIncrement(), matcher.replaceAll("")));
        });
    }
}
